<template>
  <div>
    <fm-making-form
      ref="makingform"
      style="height: 520px;"
      preview
      generate-code
      generate-json
    >
      <template slot="action">
        <el-button @click="generateCode">生成数据库</el-button>
      </template>
    </fm-making-form>
  </div>
</template>

<script>
    import {generatorApi} from "../../http/modules/generator";

    export default {
        name: "form",

      methods: {
        generateCode () {

          let json = this.$refs.makingform.getJSON()
          console.log(json)
          let jsonData = JSON.stringify(json)
          generatorApi.formGenerator({jsonData: jsonData}).then(res => {
          })
          }
      }
    }
</script>

<style scoped>

</style>
